package cn.tools8.smartExcel.config;

import cn.tools8.smartExcel.entity.ValidateResult;
import cn.tools8.smartExcel.handler.IReadRowHandler;
import cn.tools8.smartExcel.handler.IReadRowIgnoreHandler;

import java.util.ArrayList;
import java.util.List;

/**
 * 读取excel配置
 *
 * @author tuaobin 2023/6/15 10:41
 */
public class ExcelReaderConfig {
    /**
     * 密码
     */
    private String password;
    /**
     * 读取sheet页的配置
     */
    private List<ExcelReaderSheetConfig> sheetConfigs;
    /**
     * 是否验证数据
     */
    private boolean validate = true;
    /**
     * 验证组
     */
    private Class<?>[] validateGroups;
    /**
     * 不验证的bean字段值
     */
    private List<String> validateExcludeFields;

    /**
     * 验证结果列表
     */
    private List<ValidateResult> validateResults = new ArrayList<>();

    /**
     * 行数据忽略处理
     */
    private IReadRowIgnoreHandler rowIgnoreHandler;

    /**
     * 单行处理
     */
    private IReadRowHandler readRowHandler;

    /**
     * 读取注解分组
     * @return
     */
    private Class<?>[] groups;

    public IReadRowHandler getReadRowHandler() {
        return readRowHandler;
    }

    public void setReadRowHandler(IReadRowHandler readRowHandler) {
        this.readRowHandler = readRowHandler;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public List<ExcelReaderSheetConfig> getSheetConfigs() {
        return sheetConfigs;
    }

    public void setSheetConfigs(List<ExcelReaderSheetConfig> sheetConfigs) {
        this.sheetConfigs = sheetConfigs;
    }

    public boolean isValidate() {
        return validate;
    }

    public void setValidate(boolean validate) {
        this.validate = validate;
    }

    public List<String> getValidateExcludeFields() {
        return validateExcludeFields;
    }

    public void setValidateExcludeFields(List<String> validateExcludeFields) {
        this.validateExcludeFields = validateExcludeFields;
    }

    public Class<?>[] getValidateGroups() {
        return validateGroups;
    }

    public void setValidateGroups(Class<?>... validateGroups) {
        this.validateGroups = validateGroups;
    }
    public List<ValidateResult> getValidateResults() {
        return validateResults;
    }

    public void setValidateResults(List<ValidateResult> validateResults) {
        this.validateResults = validateResults;
    }

    public IReadRowIgnoreHandler getRowIgnoreHandler() {
        return rowIgnoreHandler;
    }

    public void setRowIgnoreHandler(IReadRowIgnoreHandler rowIgnoreHandler) {
        this.rowIgnoreHandler = rowIgnoreHandler;
    }

    public Class<?>[] getGroups() {
        return groups;
    }
    public void setGroups(Class<?>... groups) {
        this.groups = groups;
    }
}
